import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询生产出库单列表
export function listObMaster(query) {
    return request({
        url: '/wms/obMaster/list',
        method: 'get',
        params: query
    })
}

// 查询生产出库单详细
export function getObMaster(ObMasterId) {
    return request({
        url: '/wms/obMaster/' + parseStrEmpty(ObMasterId),
        method: 'get'
    })
}

// 新增生产出库单
export function addObMaster(data) {
    return request({
        url: '/wms/obMaster',
        method: 'post',
        data: data
    })
}

// 修改生产出库单
export function updateObMaster(data) {
    return request({
        url: '/wms/obMaster',
        method: 'put',
        data: data
    })
}

// 删除生产出库单
export function delObMaster(ObMasterId) {
    return request({
        url: '/wms/obMaster/' + ObMasterId,
        method: 'delete'
    })
}

// 车间工单发料
export function orderOut(data) {
    return request({
        url: '/wms/obMaster/workOrderOut',
        method: 'post',
        data: data
    })
}

// 出库自动配货
export function autoAllocation(data) {
    return request({
        url: '/wms/obMaster/obStockPrepare',
        method: 'post',
        data: data
    })
}
// 出库执行
export function executeAllocation(data) {
    return request({
        url: '/wms/obMaster/obExecute',
        method: 'post',
        data: data
    })
}
// 取消备货
export function cancelAllocation(data) {
    return request({
        url: '/wms/obMaster/obPrepareCancel',
        method: 'post',
        data: data
    })
}
